package a01ooppolymorphismDemo;

public class Text {
    public static void main(String[] args) {
        Student s = new Student();
        s.setName("zhangsan");
        s.setAge(18);

        Teacher t = new Teacher();
        t.setName("lisi");
        t.setAge(30);

        Administer admin = new Administer();
        admin.setName("wangwu");
        admin.setAge(40);

        register(s);
        register(t);
        register(admin);
    }

    //创建一个方法,既能接受老师对象,也可以接收学生对象,还能接收管理员对象
    //方法参数的类型,就是多态的体现
    public static void register(Person p){
        p.show();
    }
}
